﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="author" content="Aowork">
    <meta name="description" content="">
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, maximum-scale=1.0">
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no">

    <title></title>

    <link href="../css/mobile.css" rel="stylesheet" />

    <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.1.0.js"></script>
    <script src="../js/zepto.min.js"></script>
    <script src="../js/zepto.swipe.js"></script>
    <script src="../js/common.js"></script>
    <script src="../js/config.js"></script>
    <script src="../js/uiExtend.js"></script>
    <script src="../js/wx_config.js"></script>

    <script type="text/javascript">
        jc.fnInit.push(function () {
            jc.ui.header.trigger("updateTitle", "课程详情");
        });
    </script>

    <script type="text/javascript">
        var courseId = jc.hash.get("courseId");
        if (!courseId) {
            alert("参数有误");
            window.location.href = window.ctx + "courseList/courseList.html";
        }
        else {
            $.getJSON(window.path.courseDetail, { courseId: courseId }, function (result) {
                if (result.success) {
                    var data = result.data;
                    jc.ui.courseDetails.trigger("setup", data);
                    jc.ui.courseDetailsEditOutPut.trigger("setup", data.intro);


                    var lectureList = data.lectureList;
                    var lectureListData = [];

                    for (var i = 0, l = lectureList.length; i < l; i++) {
                        var cur = lectureList[i];

                        var object = {};

                        object.title = lectureList[i].title;

                        var btnTxt = "";
                        var btnHref = "";
                        var btnClass = "";

                        // if (cur.teachingMethod == 1 && cur.liveStatus == 2) {
                        //     btnTxt = "直播试听";
                        //     btnHref = window.ctx + "player/living.html#lectureId=" + cur.lectureId;
                        //     btnClass = "abtn green";
                        // }
                        // else if (cur.teachingMethod == 1 && cur.liveStatus == 3) {
                        //     btnTxt = "回放试听";
                        //     btnHref = window.ctx + "player/living.html#lectureId=" + cur.lectureId;
                        //     btnClass = "abtn green";
                        // }

                        // else if (cur.teachingMethod == 2 && cur.videoStatus == 1) {
                        //     btnTxt = "点播试听";
                        //     btnHref = window.ctx + "player/video.html#lectureId=" + cur.lectureId;
                        //     btnClass = "abtn green";
                        // }

                        // else {
                        //     btnTxt = "暂未开始";
                        //     btnHref = "";
                        //     btnClass = "abtn gray";
                        // }



                        object.btnTxt = btnTxt;
                        object.btnHref = btnHref;
                        object.btnClass = btnClass;

                        lectureListData[i] = object;
                    }


                    jc.ui.txtBtnList.trigger("setup", lectureListData);
                }
                else {
                    alert(result.desc);
                }
            });

        }
    </script>


</head>
<body>
    <div data-ui="header" class="J_header">
        <div class="h_inner"></div>
    </div>


    <div class="bgfff bb1">

        <div data-ui="courseDetails" class="J_courseDetails" data-btn-txt="直播试听">
        </div>

    </div>



    <div class="mt10 bgfff bb1">

        <div data-ui="defaultTab" data-item-width="auto" class="J_defaultTab">
            <div class="d_title">
                <div class="t_inner">
                    <div class="i_item current"><a href="javascript:;">课程详情</a></div>
                    <div class="i_item"><a href="javascript:;">课程大纲</a></div>
                </div>
            </div>
            <div class="d_main">
                <div class="m_item current">

                    <div data-ui="courseDetailsEditOutPut" class="J_courseDetailsEditOutPut">

                    </div>

                </div>
                <div class="m_item">

                    <div data-ui="txtBtnList" class="J_txtBtnList">
                        <div class="t_list">

                        </div>
                    </div>

                </div>
            </div>
        </div>

    </div>

    <div data-ui="cart" class="J_cart">
        <div class="c_inner">
            <div class="i_count">0</div>
            <div class="i_link">
                <a href="javascript:;"></a>
            </div>
        </div>
    </div>


    <div data-ui="courseDetailsFooter" class="J_courseDetailsFooter">
        <div class="c_inner">
            <div class="i_item">
                <a data-type="add" class="abtn line orange" href="javascript:;">加入购物车</a>
            </div>
            <div class="i_item">
                <a data-type="pay" class="abtn orange" href="javascript:;">马上报名</a>
            </div>
        </div>
    </div>


    <div data-ui="footer" class="J_footer">


    </div>


    <div data-ui="nav" class="J_nav">
        <div class="n_inner">
            <div class="i_center clearfix"></div>
        </div>
    </div>




</body>
</html>
